﻿using System;
using System.Data;
using System.Data.Common;
using System.Text;
using TSL.Model;
using System.Data.SqlClient;

namespace TSL.DAL
{
    public class publish
    {
        public DataSet GetToDay()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * from V_Today");
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        ///删除超时有效时间内未刷新的用户
        /// </summary>
        public void DeleteOnline_ForRefreshTime(int ActiveTimeout)
        {
            DateTime time = DateTime.Now.AddSeconds(0 - ActiveTimeout);
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from OnLine ");
            strSql.Append(" where RefreshTime < @ActiveTimeout");
			SqlParameter[] parameters = {
					new SqlParameter("@ActiveTimeout", SqlDbType.DateTime)			
                                        };
            parameters[0].Value = time;

			DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
        }
    }
}
